package com.welchapps.nporganizer;



import android.app.Activity;
import android.app.ActionBar;
import android.os.Bundle;
import android.preference.PreferenceFragment;
import android.view.MenuItem;

public class QuickPrefsActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
      ActionBar actionBar = getActionBar();
      actionBar.setDisplayHomeAsUpEnabled(true);
        // Display the fragment as the main content.
        getFragmentManager().beginTransaction()
                .replace(android.R.id.content, new SettingsFragment())
                .commit();
    }
    
    public static class SettingsFragment extends PreferenceFragment {
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);

            // Load the preferences from an XML resource
            addPreferencesFromResource(R.layout.pref);
        }
    }
    
    @Override
    public void onPause () {
    	super.onPause();
    	NotePad.Requery = true;
    }
	
//    @Override
//    public void onCreate(Bundle savedInstanceState) {        
//        super.onCreate(savedInstanceState);      
//        ActionBar actionBar = getActionBar();
//        actionBar.setDisplayHomeAsUpEnabled(true);
//        PreferenceManager prefMgr = getPreferenceManager();
//        prefMgr.setSharedPreferencesName("defSettings");
//        prefMgr.setSharedPreferencesMode(MODE_WORLD_READABLE);
//        addPreferencesFromResource(R.layout.pref);        
//    }
//    
    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
        case android.R.id.home:
        	finish();
        	return true;      
        default:
            return super.onOptionsItemSelected(item);
        }
    }
}






